import os
import json
from gxl_ai_utils.utils import utils_file
# pass_word = 'xbUEGj63KXv5Gi8,'
lines = utils_file.load_list_file_clean('./world_raw_info_4.list')
write_data = {"nodes":[]}
index = 0
for line in lines:
    line = line.strip().split()
    print(line)
    ip = line[0]
    pass_word =  line[1]
    node = {'ip': ip, 'password':pass_word, "node_id": index}
    write_data['nodes'].append(node)
    index += 1

with open('nodes_4_16.json', 'w') as f:
    json.dump(write_data, f, indent=2) 